<template>
  <div>
    <el-table :data="pageList">
      <el-table-column label="明细id" prop="orderId" show-overflow-tooltip />
      <el-table-column label="商品id" prop="supplierGoodId" />
      <el-table-column label="商品信息" prop="goodName">
        <template slot-scope="{ row }">
          <div style="display: flex; align-items: center">
            <div style="margin-right: 10px">
              <image-preview :src="row.goodImg" :width="60" :height="40" />
            </div>
            <div>{{ row.goodName }}</div>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="单价" align="center" prop="goodPrice" />
      <el-table-column label="购买数量" align="center" prop="goodCount" />
      <!-- <el-table-column label="优惠" align="center" prop="goodName">
        <template>
          接口没这个字段
        </template>
      </el-table-column> -->
      <el-table-column label="小计" align="center" prop="goodName">
        <template slot-scope="{ row }">
          {{ row.payMoney }}
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="goodTag">
        <template slot-scope="{ row }">
          {{ forrmatterEnmu(orderStatus, row.orderStatus) }}
        </template>
      </el-table-column>
      <!-- <el-table-column label="操作" align="center" fixed="right" width="120">
        <template slot-scope="{ row }">
          <el-button size="mini" type="text" v-hasPermi="['system:good:edit']"
            >主动退款{{ row.name }}</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>
  </div>
</template>

<script>
import { forrmatterEnmu } from "@/utils/index";
export default {
  name: "GoodsInfo",
  props: {
    dataList: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        goodId: null,
      },
      /**
       * 订单状态：1待发货，2配送中，3待收货，4已完成,5已退单,6已关闭
       */
      orderStatus: [
        {
          name: "待发货",
          value: 1,
        },
        {
          name: "配送中",
          value: 2,
        },
        {
          name: "待收货",
          value: 3,
        },
        {
          name: "已完成",
          value: 4,
        },
        {
          name: "已退单",
          value: 5,
        },
        {
          name: "已关闭",
          value: 6,
        },
      ],
      pageList: [],
    };
  },
  created() {},
  watch: {
    dataList: {
      deep: true,
      handler(v) {
        this.pageList = v;
      },
    },
  },
  methods: {
    forrmatterEnmu,
  },
};
</script>
<style lang="less" scoped>
.base-title {
  font-size: 18rpx;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  margin-bottom: 15px;

  &::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 15px;
    background: #1777ff;
    border-radius: 3px;
    margin-right: 8px;
  }
}
</style>
